package stack;

import java.util.Stack;
//                                       栈
public class Test1 {
    public static void main(String[] args) {
        //标准库的栈
        Stack<String> stack = new Stack<>();
        //栈最主要的三个功能
        //1.进栈
        stack.push("aaa");
        stack.push("bbb");
        stack.push("ccc");
        //2.取栈顶元素
        String top = stack.peek();
        System.out.println(top);
        //3.出栈
        String s = null;
        s = stack.pop();
        System.out.println(s);
        s = stack.pop();
        System.out.println(s);
        s = stack.pop();
        System.out.println(s);
    }
}
